import java.util.Scanner;

public class day230405 {
    // 手套
    public int findMinimum(int n, int[] left, int[] right) {
        int leftSum = 0;
        int rightSum = 0;
        int leftMin = Integer.MAX_VALUE;
        int rightMin = Integer.MAX_VALUE;
        int sum = 0;

        for (int i = 0; i < n; i++) {
            if (left[i] * right[i] == 0) {
                // 有一边手套为0的情况, 需单独计算
                sum += left[i] + right[i];
            } else {
                // 计算左右手套总数, 和手套数量的最小值
                leftSum += left[i];
                rightSum += right[i];
                leftMin = Math.min(leftMin, left[i]);
                rightMin = Math.min(rightMin, right[i]);
            }
        }
        return sum + Math.min(leftSum - leftMin + 1, rightSum - rightMin + 1) + 1;
    }


    // 查找输入整数二进制中1的个数
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int n = scanner.nextInt();
            int count = 0;
            while (n != 0) {
                if ((n & 1) == 1) {
                    count++;
                }
                // 右移 1 位
                n >>= 1;
            }
            System.out.println(count);
        }
    }
}
